<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<script runat="server">

 
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	VerbList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h1>VerbList <%= Request.QueryString[0] %></h1>    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" 
        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
        ShowFooter="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="BloomID" HeaderText="BloomID" 
                SortExpression="BloomID" Visible="False" />
            <asp:TemplateField HeaderText="Bloom" SortExpression="Name">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Verb" SortExpression="Verb">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Verb") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Status" SortExpression="Status">
                <EditItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>" 
        DeleteCommand="DELETE FROM [VerbList] WHERE [ID] = @ID" 
        InsertCommand="INSERT INTO [VerbList] ([BloomID], [Verb], [Status]) VALUES (@BloomID, @Verb, 1)" 
        SelectCommand="SELECT VerbList.ID, VerbList.BloomID, VerbList.Verb, VerbList.Status, Bloom.Name FROM VerbList INNER JOIN Bloom ON VerbList.BloomID = Bloom.ID WHERE (VerbList.BloomID = @BloomID)" 
        
        UpdateCommand="UPDATE [VerbList] SET [BloomID] = @BloomID, [Verb] = @Verb, [Status] = @Status WHERE [ID] = @ID">
        <SelectParameters>
            <asp:QueryStringParameter Name="BloomID" QueryStringField="id" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="BloomID" Type="Int32" />
            <asp:Parameter Name="Verb" Type="String" />
            <asp:Parameter Name="Status" Type="Int32" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="BloomID" Type="Int32" />
            <asp:Parameter Name="Verb" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server"
        TargetControlID="UpdatePanel1">
        <Animations>
            <OnUpdating>                
                <FadeOut minimumOpacity=".5" />
            </OnUpdating>
            <OnUpdated>
                <FadeIn minimumOpacity=".5" />
            </OnUpdated>
        </Animations>
    </asp:UpdatePanelAnimationExtender>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <img style="margin-left:50px" src="../../App_Themes/AdminTheme/images/ajax-loader.gif" />
        </ProgressTemplate>
    </asp:UpdateProgress>    
</asp:Content>
